package com.manage.func.ordermanagement.returnorder.service.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.manage.base.service.impl.BaseServiceImpl;
import com.manage.func.ordermanagement.returnorder.dao.IReturnOrderDao;
import com.manage.func.ordermanagement.returnorder.model.ReturnOrderBean;
import com.manage.func.ordermanagement.returnorder.model.ReturnOrderBooksBean;
import com.manage.func.ordermanagement.returnorder.model.ReturnOrderExcelBean;
import com.manage.func.ordermanagement.returnorder.model.ReturnOrderExportQueryBean;
import com.manage.func.ordermanagement.returnorder.service.IReturnOrderService;

@Service("returnorderServiceManage")
@Transactional
public class ReturnOrderServiceImpl
		extends BaseServiceImpl<ReturnOrderBean>
		implements IReturnOrderService {

	@Autowired
	IReturnOrderDao dao;

	@Override
	public List<ReturnOrderBean> selectReturnOrderList(ReturnOrderBean bean) {
		return dao.selectReturnOrderList(bean);
	}

	@Override
	public void updateReturnOrder(ReturnOrderBean queryBean,ReturnOrderBooksBean booksBean) {
		//更新order表的状态
		dao.updateReturnOrder(queryBean);
		//更新orderdetail表的还书时间
		dao.updateOrderDetail(booksBean);
	}

	@Override
	public int selectTotalCount(ReturnOrderBean queryBean) {
		return dao.selectTotalCount(queryBean);
	}
	
	@Override
	public List<ReturnOrderBooksBean> selectReturnOrderBooks(ReturnOrderBean queryBean) {
		return dao.selectReturnOrderBooks(queryBean);
	}
	
	@Override
	public int updateExpressMessage(ReturnOrderBean queryBean) {
		return dao.updateExpressMessage(queryBean);
	}

	@Override
	public List<ReturnOrderExcelBean> selectReturnOrderExcel(ReturnOrderExportQueryBean queryBean)
	{
		return dao.selectReturnOrderExcel(queryBean);
	}
}
